﻿using SmartHotel.DAL;
using SmartHotel.Model;

namespace SmartHotel.BLL
{
    public class OrderBLL
    {
        public OrderBLL(OrderDAL orderDAL)
        {
            OrderDAL = orderDAL;
        }

        public OrderDAL OrderDAL { get; }

        public int AddOrder(OrderModel order)
        {
            return OrderDAL.AddOrder(order);
        }
        public MyPage<OrderModel> GetOrders(int index, int size, out int count, string? username)
        {
            var data=OrderDAL.GetOrders(index, size, out count, username);
            MyPage<OrderModel> page=new MyPage<OrderModel>();
            page.Size = size;
            page.Count = count;
            page.Data = data;
            
            return page;
        }

        public OrderModel GetOrderId(int id)
        {
            return OrderDAL.GetOrderId(id);
        }

        public int LjDel(int id)
        {
            return OrderDAL.LjDel(id);

        }

        public int ZhiFu(int id) {
            return OrderDAL.ZhiFu(id);
        }
    }
}
